<?php
/**
 * 系统设置
 * User: lxl
 * Date: 2020/07/22
 */

namespace App\Service\Core\Sys\Config;

use App\Component\ListService\ListAbstract;
use App\Model\Core\Sys\SysConfigModel;
use Illuminate\Database\Query\Builder;

/**
 * @method $this setConfigItem($val)
 * @method $this setIsSys($val)
 * @package App\Service\Core\Sys\Config
 */
class SysConfigListService extends ListAbstract
{
    public function getQueryObj(): Builder
    {
        $query_obj = SysConfigModel::getInstance()->getConnectionTable();
        $config_item = $this->getParam('config_item');
        if (!empty($config_item)) {
            $query_obj->where('config_item', $config_item);
        }
        $is_sys = $this->getParam('is_sys');
        if (is_numeric($is_sys)) {
            $query_obj->where('is_sys', $is_sys);
        }
        return $query_obj;
    }
}
